package com.hao.proxy;

public class proxystatic {
    public static void main(String[] args) {
        You you = new You();
        WeddingCompany weddingCompany = new WeddingCompany(you);
        weddingCompany.HappyMarry();
    }
}

interface Marry{
    void HappyMarry();
}

// 真实角色，你去结婚，
class You implements Marry{

    @Override
    public void HappyMarry() {
        System.out.println("结芬啦~");
    }
}

// 代理角色
class WeddingCompany implements Marry{

    private Marry target;

    public WeddingCompany(Marry target) {
        this.target = target;
    }

    @Override
    public void HappyMarry() {
        before();
        this.target.HappyMarry();
        after();
    }
    private void before() {
        System.out.println("布置现场");
    }
    private void after() {
        System.out.println("收尾款");
    }
}

